#pragma once

#ifndef _EDCAMERA_H_
#define _EDCAMERA_H_

#include <queue>
using namespace std;

#include "matrix4.h"

// EDCamera
//
// Camera Control class
class EDCamera
{
	// m_CameraMat
	// 4x4 Matrix representing camera position and orientation in worldspace
	matrix4f	m_CameraMat;

	// m_DefaultPos
	// Vector storing a default position for the camera
	vec3f		m_DefaultPos;
	
	// Enumerated camera modes
	enum {MOUSE_LOOK = 0, HARD_ATTACH, SOFT_ATTACH, LOOK_AT, TURN_TO, MODE_COUNT};
	
	// m_iCameraMode
	// The current enumerated camera mode
	int m_iCameraMode;

	// m_SoftAttachQueue
	// Queue of matrices used by the SOFT_ATTACH camera mode
	queue< matrix4f > m_SoftAttachQueue;

public:
	
	// Constructor
	EDCamera(void);

	// Destructor
	virtual ~EDCamera(void);

	void OrthoNormalInverse( matrix4f &MatrixO, const matrix4f &MatrixA );
	void ApplyCameraTransform(void);
	void MouseLook( matrix4f &mat, float fTime );
	void LookAt( matrix4f &mat, const vec3f &target );
	void LookAt( const vec3f &target );
	void TurnTo( matrix4f &mat, const vec3f &target, float fTime );
	void HardAttach( matrix4f &AttachMat, const matrix4f &AttachToMat, const vec3f &offset );
	void SoftAttach( matrix4f &AttachMat, const matrix4f &AttachToMat, queue< matrix4f > &Buffer, const vec3f &offset );
	void Update(float fTime);

	void debugText(char * debug);
};

#endif
